package com.zsw.controller;


import com.zsw.entity.User;
import com.zsw.util.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

import javax.servlet.http.HttpSession;

/**
 * <p>
 * 系统用户 前端控制器
 * </p>
 *
 * @author zhangshiwei
 * @since 2023-09-22
 */
@Controller
@RequestMapping("/sys/user")
public class UserController {
    //
    @GetMapping("/getRouters")
    //这个接口，就是动态获取用户有什么菜单的
    public Result getRouters(HttpSession session){
        User user = (User) session.getAttribute("user");
        //根据userId获取
//        String role = this.roleMapper.getRoleNameByUserId(user.getUserId());
//        List<MenuRouterVO> routers = this.menuService.getMenuRouterByUserId(user.getUserId());
//        return Result.ok()
//                .put("data", user)
//                .put("roles", role)
//                .put("routers",routers);
        return  null;
    }

}

